package com.zyy.api.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 *@author zhangyangyang
 *@createTime 2023414 16:16
 *@description 需要打标的资讯信息
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class LabelNewsInfo {
    @NotNull(message = "userId 不能为空")
    private Integer userId;
    private String newsId;

    @NotBlank(message = "标题 不能为空")
    @Length(min=1, max=100, message = "参数长度不符合要求")
    private String title;
    private String summary;
    @Length(max=10000, message = "参数长度不符合要求")
    private String content;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime releasedTime;

    private Integer newsType;
}
